package com.joseph.user.feign;

import com.joseph.common.result.RpcResult;
import com.joseph.user.fallback.UserClientFallback;
import com.joseph.user.dto.response.UserRsp;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.Valid;

@FeignClient(value = "USER-SERVICE",
        fallback = UserClientFallback.class)
public interface UserClient {

    String USER_CLIENT_URL = "/user-client";

    @GetMapping(USER_CLIENT_URL + "/getUserById")
    RpcResult<UserRsp> getUserById(@RequestParam("userId") @Valid Integer userId);
}
